<template>
  <div class="info">
    <img :src="account.data.profile.avatarUrl"><br>
    <span>{{ account.data.profile.nickname }} </span> <br>
    <button @click="outLogin">退出登录</button>
  </div>
</template>

<script>
import {mapState} from 'vuex'
import {logout,refresh} from '@/request/api/home'
export default {
 methods:{
  async outLogin(){
   await logout()
  this.$store.commit('updateIsLogin',false)
  this.$router.push('/')  
  }
 },
  computed:{
    ...mapState(['account'])
  }
};
</script>

<style lang="scss" scoped>
.info {
  margin-top: 2rem;
  text-align: center;
 
  align-items: center;
img{
  border-radius: 50%;
  width: .8rem;
  height: .8rem;
}
}
</style>
